package com.secret.chain.secretchain.solidity;

import org.fisco.bcos.sdk.abi.FunctionReturnDecoder;
import org.fisco.bcos.sdk.abi.TypeReference;
import org.fisco.bcos.sdk.abi.datatypes.Function;
import org.fisco.bcos.sdk.abi.datatypes.Type;
import org.fisco.bcos.sdk.abi.datatypes.Utf8String;
import org.fisco.bcos.sdk.abi.datatypes.generated.Uint256;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple4;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple7;
import org.fisco.bcos.sdk.client.Client;
import org.fisco.bcos.sdk.contract.Contract;
import org.fisco.bcos.sdk.crypto.CryptoSuite;
import org.fisco.bcos.sdk.crypto.keypair.CryptoKeyPair;
import org.fisco.bcos.sdk.model.CryptoType;
import org.fisco.bcos.sdk.model.TransactionReceipt;
import org.fisco.bcos.sdk.model.callback.TransactionCallback;
import org.fisco.bcos.sdk.transaction.model.exception.ContractException;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@SuppressWarnings("unchecked")
public class User extends Contract {
    public static final String[] BINARY_ARRAY = {"608060405234801561001057600080fd5b50611247806100206000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063832880e711610097578063a2e6204511610066578063a2e62045146109b0578063a433ccc7146109ce578063b69ef8a8146109ec578063efc81a8c14610a0a576100f5565b8063832880e7146106c55780639284f4971461088c57806396cf30291461090f578063a2cb283514610992576100f5565b8063312ab722116100d3578063312ab7221461021e5780634a7303101461049e5780635a9b0b89146105955780635aef7de614610642576100f5565b806306fdde03146100fa578063200d2ed21461017d5780632cc0e3901461019b575b600080fd5b610102610a28565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610185610ac6565b6040518082815260200191505060405180910390f35b6101a3610acc565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101e35780820151818401526020810190506101c8565b50505050905090810190601f1680156102105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61049c6004803603608081101561023457600080fd5b810190808035906020019064010000000081111561025157600080fd5b82018360208201111561026357600080fd5b8035906020019184600183028401116401000000008311171561028557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156102e857600080fd5b8201836020820111156102fa57600080fd5b8035906020019184600183028401116401000000008311171561031c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561037f57600080fd5b82018360208201111561039157600080fd5b803590602001918460018302840111640100000000831117156103b357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561041657600080fd5b82018360208201111561042857600080fd5b8035906020019184600183028401116401000000008311171561044a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610b6a565b005b610593600480360360e08110156104b457600080fd5b810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019064010000000081111561050d57600080fd5b82018360208201111561051f57600080fd5b8035906020019184600183028401116401000000008311171561054157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610bcc565b005b61059d610c16565b6040518088815260200187815260200186815260200185815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156106015780820151818401526020810190506105e6565b50505050905090810190601f16801561062e5780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b61064a610ce8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561068a57808201518184015260208101905061066f565b50505050905090810190601f1680156106b75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106cd610d86565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019080838360005b838110156107195780820151818401526020810190506106fe565b50505050905090810190601f1680156107465780820380516001836020036101000a031916815260200191505b50858103845288818151815260200191508051906020019080838360005b8381101561077f578082015181840152602081019050610764565b50505050905090810190601f1680156107ac5780820380516001836020036101000a031916815260200191505b50858103835287818151815260200191508051906020019080838360005b838110156107e55780820151818401526020810190506107ca565b50505050905090810190601f1680156108125780820380516001836020036101000a031916815260200191505b50858103825286818151815260200191508051906020019080838360005b8381101561084b578082015181840152602081019050610830565b50505050905090810190601f1680156108785780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b610894611012565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108d45780820151818401526020810190506108b9565b50505050905090810190601f1680156109015780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6109176110b0565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561095757808201518184015260208101905061093c565b50505050905090810190601f1680156109845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61099a61114e565b6040518082815260200191505060405180910390f35b6109b8611154565b6040518082815260200191505060405180910390f35b6109d661115a565b6040518082815260200191505060405180910390f35b6109f4611160565b6040518082815260200191505060405180910390f35b610a12611166565b6040518082815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610abe5780601f10610a9357610100808354040283529160200191610abe565b820191906000526020600020905b815481529060010190602001808311610aa157829003601f168201915b505050505081565b60075481565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b625780601f10610b3757610100808354040283529160200191610b62565b820191906000526020600020905b815481529060010190602001808311610b4557829003601f168201915b505050505081565b8360009080519060200190610b8092919061116c565b508260019080519060200190610b9792919061116c565b508160029080519060200190610bae92919061116c565b508060039080519060200190610bc592919061116c565b5050505050565b86600481905550856005819055508460068190555083600781905550826008819055508160098190555080600a9080519060200190610c0c92919061116c565b5050505050505050565b6000806000806000806060600454600554600654600754600854600954600a808054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610cca5780601f10610c9f57610100808354040283529160200191610cca565b820191906000526020600020905b815481529060010190602001808311610cad57829003601f168201915b50505050509050965096509650965096509650965090919293949596565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d7e5780601f10610d5357610100808354040283529160200191610d7e565b820191906000526020600020905b815481529060010190602001808311610d6157829003601f168201915b505050505081565b6060806060806000600160026003838054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e295780601f10610dfe57610100808354040283529160200191610e29565b820191906000526020600020905b815481529060010190602001808311610e0c57829003601f168201915b50505050509350828054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ec55780601f10610e9a57610100808354040283529160200191610ec5565b820191906000526020600020905b815481529060010190602001808311610ea857829003601f168201915b50505050509250818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f615780601f10610f3657610100808354040283529160200191610f61565b820191906000526020600020905b815481529060010190602001808311610f4457829003601f168201915b50505050509150808054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ffd5780601f10610fd257610100808354040283529160200191610ffd565b82019190600052602060002090","5b815481529060010190602001808311610fe057829003601f168201915b50505050509050935093509350935090919293565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110a85780601f1061107d576101008083540402835291602001916110a8565b820191906000526020600020905b81548152906001019060200180831161108b57829003601f168201915b505050505081565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111465780601f1061111b57610100808354040283529160200191611146565b820191906000526020600020905b81548152906001019060200180831161112957829003601f168201915b505050505081565b60095481565b60065481565b60085481565b60045481565b60055481565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106111ad57805160ff19168380011785556111db565b828001600101855582156111db579182015b828111156111da5782518255916020019190600101906111bf565b5b5090506111e891906111ec565b5090565b61120e91905b8082111561120a5760008160009055506001016111f2565b5090565b9056fea2646970667358221220aa28d56740c5c58f9da51b392889cb933b8250fc7f93ac33976076853ceb32a564736f6c634300060a0033"};

    public static final String BINARY = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", BINARY_ARRAY);

    public static final String[] SM_BINARY_ARRAY = {"608060405234801561001057600080fd5b50611247806100206000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063832880e711610097578063a2e6204511610066578063a2e62045146109b0578063a433ccc7146109ce578063b69ef8a8146109ec578063efc81a8c14610a0a576100f5565b8063832880e7146106c55780639284f4971461088c57806396cf30291461090f578063a2cb283514610992576100f5565b8063312ab722116100d3578063312ab7221461021e5780634a7303101461049e5780635a9b0b89146105955780635aef7de614610642576100f5565b806306fdde03146100fa578063200d2ed21461017d5780632cc0e3901461019b575b600080fd5b610102610a28565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610185610ac6565b6040518082815260200191505060405180910390f35b6101a3610acc565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101e35780820151818401526020810190506101c8565b50505050905090810190601f1680156102105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61049c6004803603608081101561023457600080fd5b810190808035906020019064010000000081111561025157600080fd5b82018360208201111561026357600080fd5b8035906020019184600183028401116401000000008311171561028557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156102e857600080fd5b8201836020820111156102fa57600080fd5b8035906020019184600183028401116401000000008311171561031c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561037f57600080fd5b82018360208201111561039157600080fd5b803590602001918460018302840111640100000000831117156103b357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561041657600080fd5b82018360208201111561042857600080fd5b8035906020019184600183028401116401000000008311171561044a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610b6a565b005b610593600480360360e08110156104b457600080fd5b810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019064010000000081111561050d57600080fd5b82018360208201111561051f57600080fd5b8035906020019184600183028401116401000000008311171561054157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610bcc565b005b61059d610c16565b6040518088815260200187815260200186815260200185815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156106015780820151818401526020810190506105e6565b50505050905090810190601f16801561062e5780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b61064a610ce8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561068a57808201518184015260208101905061066f565b50505050905090810190601f1680156106b75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106cd610d86565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019080838360005b838110156107195780820151818401526020810190506106fe565b50505050905090810190601f1680156107465780820380516001836020036101000a031916815260200191505b50858103845288818151815260200191508051906020019080838360005b8381101561077f578082015181840152602081019050610764565b50505050905090810190601f1680156107ac5780820380516001836020036101000a031916815260200191505b50858103835287818151815260200191508051906020019080838360005b838110156107e55780820151818401526020810190506107ca565b50505050905090810190601f1680156108125780820380516001836020036101000a031916815260200191505b50858103825286818151815260200191508051906020019080838360005b8381101561084b578082015181840152602081019050610830565b50505050905090810190601f1680156108785780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b610894611012565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108d45780820151818401526020810190506108b9565b50505050905090810190601f1680156109015780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6109176110b0565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561095757808201518184015260208101905061093c565b50505050905090810190601f1680156109845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61099a61114e565b6040518082815260200191505060405180910390f35b6109b8611154565b6040518082815260200191505060405180910390f35b6109d661115a565b6040518082815260200191505060405180910390f35b6109f4611160565b6040518082815260200191505060405180910390f35b610a12611166565b6040518082815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610abe5780601f10610a9357610100808354040283529160200191610abe565b820191906000526020600020905b815481529060010190602001808311610aa157829003601f168201915b505050505081565b60075481565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b625780601f10610b3757610100808354040283529160200191610b62565b820191906000526020600020905b815481529060010190602001808311610b4557829003601f168201915b505050505081565b8360009080519060200190610b8092919061116c565b508260019080519060200190610b9792919061116c565b508160029080519060200190610bae92919061116c565b508060039080519060200190610bc592919061116c565b5050505050565b86600481905550856005819055508460068190555083600781905550826008819055508160098190555080600a9080519060200190610c0c92919061116c565b5050505050505050565b6000806000806000806060600454600554600654600754600854600954600a808054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610cca5780601f10610c9f57610100808354040283529160200191610cca565b820191906000526020600020905b815481529060010190602001808311610cad57829003601f168201915b50505050509050965096509650965096509650965090919293949596565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d7e5780601f10610d5357610100808354040283529160200191610d7e565b820191906000526020600020905b815481529060010190602001808311610d6157829003601f168201915b505050505081565b6060806060806000600160026003838054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e295780601f10610dfe57610100808354040283529160200191610e29565b820191906000526020600020905b815481529060010190602001808311610e0c57829003601f168201915b50505050509350828054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ec55780601f10610e9a57610100808354040283529160200191610ec5565b820191906000526020600020905b815481529060010190602001808311610ea857829003601f168201915b50505050509250818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f615780601f10610f3657610100808354040283529160200191610f61565b820191906000526020600020905b815481529060010190602001808311610f4457829003601f168201915b50505050509150808054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ffd5780601f10610fd257610100808354040283529160200191610ffd565b82019190600052602060002090","5b815481529060010190602001808311610fe057829003601f168201915b50505050509050935093509350935090919293565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110a85780601f1061107d576101008083540402835291602001916110a8565b820191906000526020600020905b81548152906001019060200180831161108b57829003601f168201915b505050505081565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111465780601f1061111b57610100808354040283529160200191611146565b820191906000526020600020905b81548152906001019060200180831161112957829003601f168201915b505050505081565b60095481565b60065481565b60085481565b60045481565b60055481565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106111ad57805160ff19168380011785556111db565b828001600101855582156111db579182015b828111156111da5782518255916020019190600101906111bf565b5b5090506111e891906111ec565b5090565b61120e91905b8082111561120a5760008160009055506001016111f2565b5090565b9056fea2646970667358221220aa28d56740c5c58f9da51b392889cb933b8250fc7f93ac33976076853ceb32a564736f6c634300060a0033"};

    public static final String SM_BINARY = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", SM_BINARY_ARRAY);

    public static final String[] ABI_ARRAY = {"[{\"name\":\"avatar\",\"type\":\"function\",\"constant\":true,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"view\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"}],\"methodSignatureAsString\":\"avatar()\"},{\"name\":\"balance\",\"type\":\"function\",\"constant\":true,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"view\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"}],\"methodSignatureAsString\":\"balance()\"},{\"name\":\"create\",\"type\":\"function\",\"constant\":true,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"view\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"}],\"methodSignatureAsString\":\"create()\"},{\"name\":\"fans\",\"type\":\"function\",\"constant\":true,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"view\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"}],\"methodSignatureAsString\":\"fans()\"},{\"name\":\"follow\",\"type\":\"function\",\"constant\":true,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"view\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"}],\"methodSignatureAsString\":\"follow()\"},{\"name\":\"getInfo\",\"type\":\"function\",\"constant\":true,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"view\",\"inputs\":[],\"outputs\":[{\"name\":\"_balance\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"},{\"name\":\"_create\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"},{\"name\":\"_update\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"},{\"name\":\"_status\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"},{\"name\":\"_follow\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"},{\"name\":\"_fans\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"},{\"name\":\"_openID\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"}],\"methodSignatureAsString\":\"getInfo()\"},{\"name\":\"getUser\",\"type\":\"function\",\"constant\":true,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"view\",\"inputs\":[],\"outputs\":[{\"name\":\"_name\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"},{\"name\":\"_avatar\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"},{\"name\":\"_intro\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"},{\"name\":\"_phone\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"}],\"methodSignatureAsString\":\"getUser()\"},{\"name\":\"intro\",\"type\":\"function\",\"constant\":true,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"view\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"}],\"methodSignatureAsString\":\"intro()\"},{\"name\":\"name\",\"type\":\"function\",\"constant\":true,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"view\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"}],\"methodSignatureAsString\":\"name()\"},{\"name\":\"openID\",\"type\":\"function\",\"constant\":true,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"view\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"}],\"methodSignatureAsString\":\"openID()\"},{\"name\":\"phone\",\"type\":\"function\",\"constant\":true,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"view\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"}],\"methodSignatureAsString\":\"phone()\"},{\"name\":\"setInfo\",\"type\":\"function\",\"constant\":false,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"nonpayable\",\"inputs\":[{\"name\":\"_balance\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"},{\"name\":\"_create\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"},{\"name\":\"_update\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"},{\"name\":\"_status\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"},{\"name\":\"_follow\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"},{\"name\":\"_fans\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"},{\"name\":\"_openID\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"}],\"outputs\":[],\"methodSignatureAsString\":\"setInfo(uint256,uint256,uint256,uint256,uint256,uint256,string)\"},{\"name\":\"setUser\",\"type\":\"function\",\"constant\":false,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"nonpayable\",\"inputs\":[{\"name\":\"_name\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"},{\"name\":\"_avatar\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"},{\"name\":\"_intro\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"},{\"name\":\"_phone\",\"type\":\"string\",\"indexed\":false,\"components\":null,\"typeAsString\":\"string\"}],\"outputs\":[],\"methodSignatureAsString\":\"setUser(string,string,string,string)\"},{\"name\":\"status\",\"type\":\"function\",\"constant\":true,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"view\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"}],\"methodSignatureAsString\":\"status()\"},{\"name\":\"update\",\"type\":\"function\",\"constant\":true,\"payable\":false,\"anonymous\":false,\"stateMutability\":\"view\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"indexed\":false,\"components\":null,\"typeAsString\":\"uint256\"}],\"methodSignatureAsString\":\"update()\"}]"};

    public static final String ABI = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", ABI_ARRAY);

    public static final String FUNC_AVATAR = "avatar";

    public static final String FUNC_BALANCE = "balance";

    public static final String FUNC_CREATE = "create";

    public static final String FUNC_FANS = "fans";

    public static final String FUNC_FOLLOW = "follow";

    public static final String FUNC_GETINFO = "getInfo";

    public static final String FUNC_GETUSER = "getUser";

    public static final String FUNC_INTRO = "intro";

    public static final String FUNC_NAME = "name";

    public static final String FUNC_OPENID = "openID";

    public static final String FUNC_PHONE = "phone";

    public static final String FUNC_SETINFO = "setInfo";

    public static final String FUNC_SETUSER = "setUser";

    public static final String FUNC_STATUS = "status";

    public static final String FUNC_UPDATE = "update";

    protected User(String contractAddress, Client client, CryptoKeyPair credential) {
        super(getBinary(client.getCryptoSuite()), contractAddress, client, credential);
    }

    public static String getBinary(CryptoSuite cryptoSuite) {
        return (cryptoSuite.getCryptoTypeConfig() == CryptoType.ECDSA_TYPE ? BINARY : SM_BINARY);
    }

    public String avatar() throws ContractException {
        final Function function = new Function(FUNC_AVATAR, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
        return executeCallWithSingleValueReturn(function, String.class);
    }

    public BigInteger balance() throws ContractException {
        final Function function = new Function(FUNC_BALANCE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeCallWithSingleValueReturn(function, BigInteger.class);
    }

    public BigInteger create() throws ContractException {
        final Function function = new Function(FUNC_CREATE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeCallWithSingleValueReturn(function, BigInteger.class);
    }

    public BigInteger fans() throws ContractException {
        final Function function = new Function(FUNC_FANS, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeCallWithSingleValueReturn(function, BigInteger.class);
    }

    public BigInteger follow() throws ContractException {
        final Function function = new Function(FUNC_FOLLOW, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeCallWithSingleValueReturn(function, BigInteger.class);
    }

    public Tuple7<BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, String> getInfo() throws ContractException {
        final Function function = new Function(FUNC_GETINFO, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple7<BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, String>(
                (BigInteger) results.get(0).getValue(), 
                (BigInteger) results.get(1).getValue(), 
                (BigInteger) results.get(2).getValue(), 
                (BigInteger) results.get(3).getValue(), 
                (BigInteger) results.get(4).getValue(), 
                (BigInteger) results.get(5).getValue(), 
                (String) results.get(6).getValue());
    }

    public Tuple4<String, String, String, String> getUser() throws ContractException {
        final Function function = new Function(FUNC_GETUSER, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple4<String, String, String, String>(
                (String) results.get(0).getValue(), 
                (String) results.get(1).getValue(), 
                (String) results.get(2).getValue(), 
                (String) results.get(3).getValue());
    }

    public String intro() throws ContractException {
        final Function function = new Function(FUNC_INTRO, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
        return executeCallWithSingleValueReturn(function, String.class);
    }

    public String name() throws ContractException {
        final Function function = new Function(FUNC_NAME, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
        return executeCallWithSingleValueReturn(function, String.class);
    }

    public String openID() throws ContractException {
        final Function function = new Function(FUNC_OPENID, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
        return executeCallWithSingleValueReturn(function, String.class);
    }

    public String phone() throws ContractException {
        final Function function = new Function(FUNC_PHONE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
        return executeCallWithSingleValueReturn(function, String.class);
    }

    public TransactionReceipt setInfo(BigInteger _balance, BigInteger _create, BigInteger _update, BigInteger _status, BigInteger _follow, BigInteger _fans, String _openID) {
        final Function function = new Function(
                FUNC_SETINFO, 
                Arrays.<Type>asList(new Uint256(_balance),
                new Uint256(_create),
                new Uint256(_update),
                new Uint256(_status),
                new Uint256(_follow),
                new Uint256(_fans),
                new Utf8String(_openID)),
                Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public void setInfo(BigInteger _balance, BigInteger _create, BigInteger _update, BigInteger _status, BigInteger _follow, BigInteger _fans, String _openID, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_SETINFO, 
                Arrays.<Type>asList(new Uint256(_balance),
                new Uint256(_create),
                new Uint256(_update),
                new Uint256(_status),
                new Uint256(_follow),
                new Uint256(_fans),
                new Utf8String(_openID)),
                Collections.<TypeReference<?>>emptyList());
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForSetInfo(BigInteger _balance, BigInteger _create, BigInteger _update, BigInteger _status, BigInteger _follow, BigInteger _fans, String _openID) {
        final Function function = new Function(
                FUNC_SETINFO, 
                Arrays.<Type>asList(new Uint256(_balance),
                new Uint256(_create),
                new Uint256(_update),
                new Uint256(_status),
                new Uint256(_follow),
                new Uint256(_fans),
                new Utf8String(_openID)),
                Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple7<BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, String> getSetInfoInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_SETINFO, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple7<BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, String>(

                (BigInteger) results.get(0).getValue(), 
                (BigInteger) results.get(1).getValue(), 
                (BigInteger) results.get(2).getValue(), 
                (BigInteger) results.get(3).getValue(), 
                (BigInteger) results.get(4).getValue(), 
                (BigInteger) results.get(5).getValue(), 
                (String) results.get(6).getValue()
                );
    }

    public TransactionReceipt setUser(String _name, String _avatar, String _intro, String _phone) {
        final Function function = new Function(
                FUNC_SETUSER, 
                Arrays.<Type>asList(new Utf8String(_name),
                new Utf8String(_avatar),
                new Utf8String(_intro),
                new Utf8String(_phone)),
                Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public void setUser(String _name, String _avatar, String _intro, String _phone, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_SETUSER, 
                Arrays.<Type>asList(new Utf8String(_name),
                new Utf8String(_avatar),
                new Utf8String(_intro),
                new Utf8String(_phone)),
                Collections.<TypeReference<?>>emptyList());
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForSetUser(String _name, String _avatar, String _intro, String _phone) {
        final Function function = new Function(
                FUNC_SETUSER, 
                Arrays.<Type>asList(new Utf8String(_name),
                new Utf8String(_avatar),
                new Utf8String(_intro),
                new Utf8String(_phone)),
                Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple4<String, String, String, String> getSetUserInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_SETUSER, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple4<String, String, String, String>(

                (String) results.get(0).getValue(), 
                (String) results.get(1).getValue(), 
                (String) results.get(2).getValue(), 
                (String) results.get(3).getValue()
                );
    }

    public BigInteger status() throws ContractException {
        final Function function = new Function(FUNC_STATUS, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeCallWithSingleValueReturn(function, BigInteger.class);
    }

    public BigInteger update() throws ContractException {
        final Function function = new Function(FUNC_UPDATE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeCallWithSingleValueReturn(function, BigInteger.class);
    }

    public static User load(String contractAddress, Client client, CryptoKeyPair credential) {
        return new User(contractAddress, client, credential);
    }

    public static User deploy(Client client, CryptoKeyPair credential) throws ContractException {
        return deploy(User.class, client, credential, getBinary(client.getCryptoSuite()), "");
    }
}
